<template>
    <div class="subpage">
        <div class="banner"></div>
        <div class="subjectinfo">
            <div class="userinfo">
                <ul class="userul">
                    <li>高三年级</li>
                </ul>
                <el-menu
                    class="el-menu-vertical-demo"
                    background-color="#ca0000"
                    text-color="#fff"
                    default-active="1-1"
                    active-text-color="#ca0000">
                    <el-submenu index="1">
                        <template slot="title">
                            <span class="haha">{{ sub }}</span>
                        </template>
                        <el-menu-item index="1-1">课程一</el-menu-item>
                        <el-menu-item index="1-2">课程二</el-menu-item>
                        <el-menu-item index="1-3">课程三</el-menu-item>
                    </el-submenu>
                </el-menu>
            </div>
            <div class="subinfo">
                <div class="back">返回上一页 >></div>
                <div class="subbox">
                    <ul class="clearfix">
                        <li class="typeitem" v-for="(item,index) in 8" :key="index">
                            <router-link :to="`/LearnContent/${type}`">
                                <img src="/static/image/course2.png" class="image"><p class="teacher">语文</p><span>加强英语学习</span>
                            </router-link>
                        </li>
                    </ul>
                    <div class="page">
                        <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="1000">
                        </el-pagination>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
</template>

<script>
export default {
    data(){
        return{
            sub:'',
            type:1
        }
    },
    mounted(){
          this.type =  localStorage.getItem('type') || 1;
        
         const id = this.$route.params.id;
            let subList =[
                {label:'语文',value:1},
                {label:'数学',value:2},
                {label:'化学',value:3},
                {label:'英语',value:4},
                {label:'物理',value:5},
                {label:'生物',value:6}
            ];
            subList.forEach((item)=>{
                if(item.value == id){
                 return  this.sub = item.label;
                }
            })
    }
}
</script>


<style lang='scss' scoped>
.subpage{
    .banner{
        width: 100%;
        height: 360px;
        background: url('/static/image/bannerpic.png') no-repeat;
        background-size:100% 100%;
        background-position: center; 
    }
    .subjectinfo{
        width: 1200px;
        margin: 0 auto;
        background-color: #ca0000;
        padding: 10px;
        min-height: 500px;
        display: flex;
        margin-top: 20px;
        margin-bottom: 20px;
        .userinfo{
            width: 200px;
            height: 100%;
            .userul{
                width: 100%;
                color: #fff;
                padding-left: 20px;
                padding-top: 20px;
                li{
                    height: 45px;
                    .text2{text-indent: 2em;line-height: 30px;}
                }
            }
            
            .el-menu-item.is-active {
                 background-color: #fff !important;
            }
        }
        .subinfo{
            flex: 1;
            height: 100%;
            background-color: #fff;
            padding: 10px;
            .back{
                width: 100%;
                text-align: right;
                color:#ca0000;
                cursor: pointer;
            }
            .subbox{
                width: 100%;
                .page{
                    width: 100%;
                    text-align: center;
                }
            }
        }

    }
}

  .subbox ul {
      width: 100%;
      box-sizing: border-box;
      padding: 10px;
  }
  .subbox{
    width: 100%;
    box-sizing: border-box;
  }
  .subbox li {
    box-sizing: border-box;
    width: 200px;
    min-height: 160px;
    float: left;
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 30px;
    text-align: left;
    img{
        width: 200px;
        height:108px;
        display: block;
    }
    p{line-height: 36px;font-weight: 500;color:#000000;font-size: 18px;}
    span{
        color: #919191;
        font-size: 16px;
    }
  }

  
</style>